#include<bits/stdc++.h>
#define rg register
#define file(x)freopen(x".in","r",stdin);freopen(x".out","w",stdout)

using namespace std;

random_device rd;
mt19937_64 rnd(rd());

int main()
{
	int n=rnd()%100+50,Q=rnd()%1000+1;
	cout<<n<<" "<<Q<<endl;
	for(rg int i=1;i<=n;i+=1)putchar('0'+(rnd()&1));puts("");
	while(Q--)
	{
		int l=rnd()%n+1,r=rnd()%n+1;
		if(l>r)swap(l,r);
		cout<<l<<" "<<r<<endl;
	}
	return 0;
}
